import request from '@/utils/request'

// 查询番剧列表
export function listAnimation(query) {
  return request({
    url: '/animation/list',
    method: 'get',
    params: query
  })
}

// 查询番剧详细
export function getAnimation(id) {
  return request({
    url: '/animation/getOneAnimation/' + id,
    method: 'get'
  })
}

// 新增番剧
export function addAnimation(data) {
  return request({
    url: '/animation/insertOrUpdate',
    method: 'post',
    data: data
  })
}

// 修改番剧
export function updateAnimation(data) {
  return request({
    url: '/animation/insertOrUpdate',
    method: 'post',
    data: data
  })
}

// 删除番剧
export function delAnimation(id) {
  return request({
    url: '/animation/delete/' + id,
    method: 'post'
  })
}

// es·查询
export function listAnimationByEs(query) {
  return request({
    url: '/animation/listByES',
    method: 'get',
    params: {
      text: query
    }
  })
}
